package test;

import static org.junit.Assert.*;
import junit.framework.Assert;
import modele.Segment;
import modele.Point;
import org.junit.Test;

public class testSegment  {

	@Test
    public void testsymetrieX() {
        Point Origine = new Point(5,10);
        Point Extremite = new Point(10,20);
        Segment s = new Segment(Origine,Extremite);
        s.symetrieX(new Point(0,0));
        Assert.assertEquals(-10, s.getOrigine().getY());
        Assert.assertEquals(-20, s.getExtremite().getY());}	
	
	@Test
    public void testsymetrieY() {
        Point p = new Point(5,10);
        Point p2 = new Point(10,20);
        Segment s = new Segment(p,p2);
        s.symetrieY(new Point(0,0));
        Assert.assertEquals(-5, s.getOrigine().getX());
        Assert.assertEquals(-10, s.getExtremite().getX());}	
	
	@Test
    public void testsymetrieO() {
        Point p = new Point(5,10);
        Point p2 = new Point(10,20);
        Segment s = new Segment(p,p2);
        s.symetrieO(new Point(0,0));
        Assert.assertEquals(-5, s.getOrigine().getX());
        Assert.assertEquals(-10, s.getExtremite().getX());
        Assert.assertEquals(-10, s.getOrigine().getY());
        Assert.assertEquals(-20, s.getExtremite().getY());}	
	
}
